﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rhino.Mocks;
using WindowsPhone.CompactContainer.ServiceLocation;

namespace WindowsPhone.CompactContainer.Tests.ServiceLocation
{
    [TestClass]
    public class ServiceLocatorTests
    {
        private IServiceLocator _mockServiceLocator;

        [TestInitialize]
        public void Setup()
        {
            _mockServiceLocator = MockRepository.GenerateMock<IServiceLocator>();    
        }

        [TestMethod]
        public void ShouldBeAbleToSetServiceLocationProvider()
        {
            ServiceLocator.SetLocatorProvider(() => _mockServiceLocator);

            Assert.AreSame(_mockServiceLocator, ServiceLocator.Current);
        }
    }
}
